import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 库存信息
 */
@Entity('product_stock')
export class ProductStockEntity extends BaseEntity {
  @Index()
  @Column({ comment: '商品ID' })
  productId: number;

  @Column({ comment: '当前库存数量', default: 0 })
  currentStockQuantity: number;

  @Column({ comment: '库存预警阈值', default: 10 })
  stockWarningThreshold: number;

  @Column({ comment: '最近库存变更时间', type: 'datetime', nullable: true })
  lastStockChangeTime: Date;
}
